import tensorflow as tf


def tensorflow_demo():
    # 原生python实现加法
    a = 2
    b = 3
    c = a + b
    print('a + b = ', c)
    # tensorflow实现加法
    t_a = tf.constant(2)
    t_b = tf.constant(3)
    t_c = t_a + t_b
    print('t_a + t_b = ', t_c)

    # 开启会话
    with tf.compat.v1.Session() as sess:
        c_t_value = sess.run(t_c)
        print('c_t_value=', c_t_value)

    return None


if __name__ == '__main__':
    tensorflow_demo()
